import request from '@/utils/request'

export function getProduction(pid) {
  return request({
    url: '/production/get',
    params: {
      'id': pid
    },
    method: 'get'
  })
}

export function listProduction(pos, size, conditions) {
  return request({
    url: '/production/list',
    params: {
      'jsonCondition': JSON.stringify(conditions),
      'pos': pos,
      'size': size
    },
    method: 'get'
  })
}
export function ListByKeyword(keyword) {
  return request({
    url: '/production/listbykeyword',
    params: {
      'keyword': keyword
    },
    method: 'get'
  })
}
export function getPriceByProduction(pid, dimensions) {
  return request({
    url: '/production/getpricebyproduction',
    params: {
      'pid': pid,
      'dArr': dimensions
    },
    method: 'get'
  })
}
export function delProduction(productionmodel) {
  return request({
    url: '/production/del',
    data: productionmodel,
    method: 'post'
  })
}
export function delProductions(jsonProductionModel) {
  return request({
    url: '/production/bulkdel',
    data: {
      data: jsonProductionModel
    },
    method: 'post'
  })
}
export function setProduction(productionmodel) {
  return request({
    url: '/production/set',
    data: productionmodel,
    method: 'post'
  })
}
